package IMIC.NGUYENVANTINH.OOP.LEVEL2.EX1;

public class Models {

	public double Area(TriangleEntity objTriangle) {
		double p = ((objTriangle.getSide1() + objTriangle.getSide2() + objTriangle.getSide3())/ 2);
		double S = Math.sqrt(p * (p - objTriangle.getSide1()) 
				   * (p - objTriangle.getSide2())
				   * (p - objTriangle.getSide3()));
		
		return S;
	}
	public double Perimeter(TriangleEntity objTriangle){
		return ( objTriangle.getSide1()
				+objTriangle.getSide2()
				+objTriangle.getSide3());
	}


}
